CacheUtility = {
		_HTML5		: 	window.sessionStorage ? true:false,
		_cache		: 	null,
		_exp		: 	24*24*60*1000,
		setStorageType:	function(storageType){
							if(this._HTML5){
								if(storageType == "session"){
									this._cache = window.sessionStorage;
								}
								else if(storageType == "local"){
									this._cache = window.localStorage;
								}
							}
							else{
								this._cache = {};
							}
		},
		
		set			:	function(item,value,time){
							if(time){
								this._exp = time;
							}
	    	 				var n = new Date();
							if(this._HTML5){
								try{
									this._cache.setItem(item.toString(),escape(value));
								}catch(e){
									if(e.code == 22){
						    	    	this._cache.clear();
						    	    	this._cache.setItem(item.toString(),escape(value));
						    	    }
								}
								item = item.toString() + "Exp";
						    	this._cache.setItem(item,n);
							}else{
								this._cache[item] = [escape(value), n];
							}
							
		},
		
		get			:	function(item){
							if(this._HTML5){
								return this._cache.getItem(item.toString());
								
							}else{
								return this._cache[item.toString()];
							}
		},
		
		isExpired	: 	function(item){
							var n = new Date();
						    if(this._HTML5){
						    	item = item+"Exp";
						    	if (new Date(this._cache.getItem(item)) > (n - this._exp)) return false;
						        return true;
						    }
						    else{
							    if (this._cache[item][1] > (n - this._exp)) return false;
							    return true;
							}
		},
		
		remove		:	function(item){
							if(this._HTML5){
								this._cache.removeItem(item);
								this._cache.removeItem(item+"Exp");
						    }
						    else{
						    	this._cache[item] = this._cache[item+"Exp"] = undefined;
							}
		}
}